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

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

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

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

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

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

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

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

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

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

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

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

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

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

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