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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: A = None
        self.p: G = None
        self.y: F = None
        self.u: E = None
        self.w: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.r: B = None
        self.x: D = None
        self.u: C = None
        self.z: A = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: A = None
        self.p: G = None
        self.y: F = None
        self.u: E = None
        self.w: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.o: A = None
        self.r: B = None
        self.x: D = None
        self.u: C = None
        self.z: A = None
        self.w: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.o: B = None
        self.x: D = None
        self.txt = txt

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

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