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

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

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

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

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

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

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

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

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

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

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

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

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

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

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