class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: H = None
        self.w: G = None
        self.v: D = None
        self.s: D = None
        self.t: H = None
        self.o: I = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: A = None
        self.q: I = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.p: J = None
        self.r: H = None
        self.q: I = None
        self.z: F = None
        self.w: C = None
        self.v: A = None
        self.y: G = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: I = None
        self.t: D = None
        self.u: I = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: A = None
        self.y: G = None
        self.p: J = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: B = None
        self.t: F = None
        self.q: B = None
        self.x: B = None
        self.s: B = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: H = None
        self.y: C = None
        self.w: C = None
        self.q: B = None
        self.z: G = None
        self.o: C = None
        self.x: J = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: I = None
        self.s: G = None
        self.txt = txt

h = A("h")
e = B("e")
b = C("b")
m = D("m")
k = E("k")
l = F("l")
c = G("c")
j = H("j")
f = I("f")
n = J("n")

h.u = j
h.x = j
h.t = j
h.w = c
h.v = m
h.s = m
h.o = f
h.y = b
e.v = c
e.w = h
e.q = f
e.z = b
e.y = k
b.w = e
b.p = e
m.t = k
m.x = b
m.w = b
m.p = n
m.r = j
m.q = f
m.z = l
m.v = h
m.s = h
m.y = c
k.z = f
k.s = f
k.u = f
k.t = m
k.r = e
l.u = n
l.p = n
l.v = h
l.y = c
l.s = f
l.x = f
c.o = l
c.t = l
c.z = e
c.q = e
c.x = e
c.s = e
c.v = f
j.x = e
f.t = h
f.p = h
f.s = j
f.y = b
f.w = b
f.o = b
f.q = e
f.z = c
f.x = n
n.v = m
n.y = f
n.s = c
assert k.t.t.r.v.z.z.p.z.p.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: H = None
        self.w: G = None
        self.v: D = None
        self.s: D = None
        self.t: H = None
        self.o: I = None
        self.y: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: A = None
        self.q: I = None
        self.z: C = None
        self.y: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: C = None
        self.p: J = None
        self.r: H = None
        self.q: I = None
        self.z: F = None
        self.w: C = None
        self.v: A = None
        self.y: G = None
        self.s: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.s: I = None
        self.t: D = None
        self.u: I = None
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: J = None
        self.v: A = None
        self.y: G = None
        self.p: J = None
        self.s: I = None
        self.x: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.z: B = None
        self.t: F = None
        self.q: B = None
        self.x: B = None
        self.s: B = None
        self.v: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: H = None
        self.y: C = None
        self.w: C = None
        self.q: B = None
        self.z: G = None
        self.o: C = None
        self.x: J = None
        self.p: A = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.v: D = None
        self.y: I = None
        self.s: G = None
        self.txt = txt

h = A("h")
e = B("e")
b = C("b")
m = D("m")
k = E("k")
l = F("l")
c = G("c")
j = H("j")
f = I("f")
n = J("n")

h.u = j
h.x = j
h.t = j
h.w = c
h.v = m
h.s = m
h.o = f
h.y = b
e.v = c
e.w = h
e.q = f
e.z = b
e.y = k
b.w = e
b.p = e
m.t = k
m.x = b
m.w = b
m.p = n
m.r = j
m.q = f
m.z = l
m.v = h
m.s = h
m.y = c
k.z = f
k.s = f
k.u = f
k.t = m
k.r = e
l.u = n
l.p = n
l.v = h
l.y = c
l.s = f
l.x = f
c.o = l
c.t = l
c.z = e
c.q = e
c.x = e
c.s = e
c.v = f
j.x = e
f.t = h
f.p = h
f.s = j
f.y = b
f.w = b
f.o = b
f.q = e
f.z = c
f.x = n
n.v = m
n.y = f
n.s = c
assert k.t.t.r.v.z.z.p.z.p.w.txt == "h"