You should train for case1(once),case2(once),case3(once),case4(once) --> repeat again until it learns all four. Not a single case. Make single iteration per case. You need to make it learn plastic. For your teaching scheme, when you teach case2, it forgets case1. You need to feed all cases repeatedly in a common while loop until total error diminishes to a lower limit.
When you make it learn only single case, it learns it good but forgets others. So you feed one after another and take a group of cases' total error (maybe sum of squared errors) to be smaller than a tolerance.