class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: B = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.p: D = None
        self.w: F = None
        self.r: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

l.x = e
l.r = i
l.u = i
l.o = c
i.u = n
c.x = i
c.o = b
c.p = b
c.w = e
c.r = e
c.y = e
b.q = e
b.p = n
n.u = l
n.v = e
e.o = b
assert i.u.u.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.r: B = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: D = None
        self.p: D = None
        self.w: F = None
        self.r: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

l.x = e
l.r = i
l.u = i
l.o = c
i.u = n
c.x = i
c.o = b
c.p = b
c.w = e
c.r = e
c.y = e
b.q = e
b.p = n
n.u = l
n.v = e
e.o = b
assert i.u.u.r.txt == "i"