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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.z: F = None
        self.u: C = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

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

m = A("m")
c = B("c")
f = C("f")
a = D("a")
g = E("g")
l = F("l")
b = D("b")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: C = None
        self.z: F = None
        self.u: C = None
        self.r: C = None
        self.q: D = None
        self.txt = txt

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

m = A("m")
c = B("c")
f = C("f")
a = D("a")
g = E("g")
l = F("l")
b = D("b")

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