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

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

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

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

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

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

e = A("e")
m = B("m")
b = C("b")
a = D("a")
i = E("i")
f = F("f")

e.s = i
e.t = i
e.y = i
e.z = b
e.u = b
e.w = a
m.v = e
m.u = f
b.s = f
a.y = f
a.r = b
i.q = e
f.s = i
f.t = i
f.r = i
f.x = a
assert a.r.s.t.q.z.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: E = None
        self.z: C = None
        self.w: D = None
        self.u: C = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

e = A("e")
m = B("m")
b = C("b")
a = D("a")
i = E("i")
f = F("f")

e.s = i
e.t = i
e.y = i
e.z = b
e.u = b
e.w = a
m.v = e
m.u = f
b.s = f
a.y = f
a.r = b
i.q = e
f.s = i
f.t = i
f.r = i
f.x = a
assert a.r.s.t.q.z.s.txt == "f"