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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: F = None
        self.x: C = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: F = None
        self.x: C = None
        self.txt = txt

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

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

l.u = d
l.q = j
l.p = j
l.z = f
l.t = c
j.y = c
c.z = f
a.t = c
d.o = l
d.p = f
d.x = c
f.z = c
f.t = l
f.r = l
f.y = d
assert j.y.z.y.p.y.txt == "d"