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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

a = A("a")
k = B("k")
h = C("h")
m = D("m")
c = E("c")
f = F("f")
b = G("b")
g = H("g")
n = C("n")
l = C("l")

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: H = None
        self.o: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.u: E = None
        self.v: A = None
        self.txt = txt

a = A("a")
k = B("k")
h = C("h")
m = D("m")
c = E("c")
f = F("f")
b = G("b")
g = H("g")
n = C("n")
l = C("l")

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