#include <stdio.h>
#include <limits.h>
#define N 10000

int main( void ) {
  while( 1 ) {

    int i;
    int n,          m;
    int up[ N ],    dw[ N ];
    int nn = 0,     mm = 0;
    int cur = 0, max = 0;

    scanf( "%d%d", &n, &m );
    if( !n && !m ) break;

    up[ 0 ] = 0;
    dw[ 0 ] = 0;

    for( i = 0; i < n; i++ ) scanf( "%d", &up[ i ] ); up[ i ] = INT_MAX;
    for( i = 0; i < m; i++ ) scanf( "%d", &dw[ i ] ); dw[ i ] = INT_MAX;

    while( 1 ) {
      if( nn < n && up[ nn ] <= dw[ mm ] ) {
        if( max < up[ nn ] - cur )
          max = up[ nn ] - cur;
        cur = up[ nn ];
        nn++;
      } else if( mm < m && up[ nn ] > dw[ mm ] ) {
        if( max < dw[ mm ] - cur )
          max = dw[ mm ] - cur;
        cur = dw[ mm ];
        mm++;
      } else {
        break;
      }
    }

    printf( "%d\n", max );

  }
  return( 0 );
}