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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.v: B = None
        self.s: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: D = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

f = A("f")
m = B("m")
l = C("l")
d = D("d")
i = E("i")
j = F("j")

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: C = None
        self.v: B = None
        self.s: A = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.o: D = None
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

f = A("f")
m = B("m")
l = C("l")
d = D("d")
i = E("i")
j = F("j")

f.t = d
f.z = d
f.s = l
f.r = i
f.y = j
m.r = l
m.s = l
m.o = f
l.z = j
l.o = m
l.u = m
l.p = f
d.p = m
d.v = m
d.x = m
d.o = l
d.s = f
i.q = m
i.s = m
i.o = d
i.u = l
j.o = d
j.x = m
assert j.o.o.z.o.s.t.txt == "d"