class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: H = None
        self.t: D = None
        self.v: G = None
        self.z: H = None
        self.r: H = None
        self.s: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: C = None
        self.u: C = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.u: J = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: J = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.q: J = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: A = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.q: G = None
        self.w: I = None
        self.u: G = None
        self.t: E = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: C = None
        self.u: C = None
        self.s: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: J = None
        self.u: J = None
        self.z: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: J = None
        self.r: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.o: A = None
        self.q: J = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.t: A = None
        self.txt = txt

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

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

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

class J:
    def __init__(self, txt: str):
        self.o: G = None
        self.z: E = None
        self.q: G = None
        self.w: I = None
        self.u: G = None
        self.t: E = None
        self.txt = txt

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

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