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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

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

e.o = c
e.s = c
e.y = c
e.p = m
e.x = m
e.q = b
i.o = b
i.q = e
i.w = e
l.x = f
b.q = f
b.s = i
c.p = b
c.w = l
m.q = i
m.y = c
m.s = f
f.x = l
assert i.o.q.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: E = None
        self.y: E = None
        self.p: F = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: C = None
        self.txt = txt

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

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

e.o = c
e.s = c
e.y = c
e.p = m
e.x = m
e.q = b
i.o = b
i.q = e
i.w = e
l.x = f
b.q = f
b.s = i
c.p = b
c.w = l
m.q = i
m.y = c
m.s = f
f.x = l
assert i.o.q.x.x.x.x.x.txt == "l"