class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.r: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: C = None
        self.y: E = None
        self.s: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: C = None
        self.y: E = None
        self.s: B = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: C = None
        self.s: F = None
        self.txt = txt

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

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

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