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

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.txt = txt

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

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

a.t = e
d.t = f
m.q = d
m.s = a
m.t = a
m.p = f
m.z = l
i.x = l
i.v = a
l.v = e
l.t = d
e.z = l
e.o = d
e.v = d
c.x = l
c.v = a
f.q = d
f.s = a
f.t = a
f.p = m
f.z = l
assert f.z.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.v: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: B = None
        self.txt = txt

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

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

a.t = e
d.t = f
m.q = d
m.s = a
m.t = a
m.p = f
m.z = l
i.x = l
i.v = a
l.v = e
l.t = d
e.z = l
e.o = d
e.v = d
c.x = l
c.v = a
f.q = d
f.s = a
f.t = a
f.p = m
f.z = l
assert f.z.t.t.q.txt == "d"