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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: E = None
        self.t: F = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: E = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.x: B = None
        self.q: A = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.s: E = None
        self.t: F = None
        self.x: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.q: E = None
        self.t: F = None
        self.w: A = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.y: E = None
        self.u: D = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: D = None
        self.x: B = None
        self.q: A = None
        self.u: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: B = None
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = None
        self.x: E = None
        self.s: G = None
        self.w: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.w: G = None
        self.s: E = None
        self.t: F = None
        self.x: C = None
        self.txt = txt

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

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