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

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

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

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

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

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

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

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

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

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

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

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

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

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

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