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

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

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

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

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

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

b = A("b")
a = B("a")
c = C("c")
f = D("f")
n = E("n")
m = F("m")

b.z = m
b.r = c
b.w = c
b.s = n
b.t = n
a.y = f
a.t = c
c.t = b
c.r = n
f.w = b
f.x = a
n.x = f
n.o = f
m.z = a
m.p = n
m.r = n
m.t = b
m.x = c
m.s = c
assert f.x.t.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: C = None
        self.s: E = None
        self.w: C = None
        self.t: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
a = B("a")
c = C("c")
f = D("f")
n = E("n")
m = F("m")

b.z = m
b.r = c
b.w = c
b.s = n
b.t = n
a.y = f
a.t = c
c.t = b
c.r = n
f.w = b
f.x = a
n.x = f
n.o = f
m.z = a
m.p = n
m.r = n
m.t = b
m.x = c
m.s = c
assert f.x.t.r.x.txt == "f"