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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: C = None
        self.v: A = None
        self.o: F = None
        self.s: F = None
        self.y: A = None
        self.txt = txt

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

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

a = A("a")
c = B("c")
n = C("n")
e = D("e")
h = E("h")
l = F("l")

a.y = l
a.o = e
a.x = n
c.z = a
c.q = l
c.u = n
c.t = e
c.w = h
n.r = c
e.r = c
e.q = n
e.v = a
e.y = a
e.o = l
e.s = l
h.x = c
h.y = a
l.o = e
l.p = e
l.y = a
l.s = h
l.w = n
assert c.z.y.p.r.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: D = None
        self.x: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: C = None
        self.v: A = None
        self.o: F = None
        self.s: F = None
        self.y: A = None
        self.txt = txt

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

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

a = A("a")
c = B("c")
n = C("n")
e = D("e")
h = E("h")
l = F("l")

a.y = l
a.o = e
a.x = n
c.z = a
c.q = l
c.u = n
c.t = e
c.w = h
n.r = c
e.r = c
e.q = n
e.v = a
e.y = a
e.o = l
e.s = l
h.x = c
h.y = a
l.o = e
l.p = e
l.y = a
l.s = h
l.w = n
assert c.z.y.p.r.t.txt == "e"