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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.u: B = None
        self.r: C = None
        self.z: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.u: B = None
        self.r: C = None
        self.z: B = None
        self.t: B = None
        self.txt = txt

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

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

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

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