class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: G = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: F = None
        self.q: I = None
        self.p: H = None
        self.o: A = None
        self.w: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: H = None
        self.t: B = None
        self.s: A = None
        self.q: A = None
        self.o: E = None
        self.p: F = None
        self.y: I = None
        self.z: B = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: G = None
        self.z: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.o: E = None
        self.p: E = None
        self.r: I = None
        self.t: B = None
        self.w: I = None
        self.u: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: G = None
        self.t: F = None
        self.r: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.y: F = None
        self.q: I = None
        self.p: H = None
        self.o: A = None
        self.w: F = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.u: H = None
        self.t: B = None
        self.s: A = None
        self.q: A = None
        self.o: E = None
        self.p: F = None
        self.y: I = None
        self.z: B = None
        self.v: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: E = None
        self.v: G = None
        self.z: E = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: D = None
        self.o: E = None
        self.p: E = None
        self.r: I = None
        self.t: B = None
        self.w: I = None
        self.u: C = None
        self.txt = txt

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

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