class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: D = None
        self.t: C = None
        self.z: C = None
        self.u: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: C = None
        self.t: F = None
        self.p: B = None
        self.x: F = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: G = None
        self.w: A = None
        self.q: A = None
        self.o: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.p: E = None
        self.o: F = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

b = A("b")
i = B("i")
d = C("d")
g = D("g")
e = E("e")
f = F("f")
l = G("l")
m = H("m")
c = E("c")
k = C("k")

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

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

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.y: C = None
        self.t: F = None
        self.p: B = None
        self.x: F = None
        self.s: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.p: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: G = None
        self.w: A = None
        self.q: A = None
        self.o: H = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: A = None
        self.p: E = None
        self.o: F = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

b = A("b")
i = B("i")
d = C("d")
g = D("g")
e = E("e")
f = F("f")
l = G("l")
m = H("m")
c = E("c")
k = C("k")

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