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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

e.s = n
e.u = a
e.t = d
n.y = f
n.x = f
n.z = d
c.q = a
c.o = e
m.s = n
m.r = n
d.r = e
a.w = e
a.y = n
a.z = d
a.u = d
f.w = e
f.y = n
f.z = d
f.u = d
assert e.t.r.t.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: F = None
        self.t: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: B = None
        self.z: E = None
        self.u: E = None
        self.txt = txt

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

e.s = n
e.u = a
e.t = d
n.y = f
n.x = f
n.z = d
c.q = a
c.o = e
m.s = n
m.r = n
d.r = e
a.w = e
a.y = n
a.z = d
a.u = d
f.w = e
f.y = n
f.z = d
f.u = d
assert e.t.r.t.r.u.txt == "a"