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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
c = C("c")
n = D("n")
j = E("j")
a = F("a")

l.r = m
m.z = j
m.t = j
m.p = l
c.p = l
c.v = m
c.u = n
n.x = m
n.y = m
n.r = c
n.o = l
n.u = j
j.x = a
j.v = a
j.p = c
j.q = c
j.w = l
a.u = n
assert j.v.u.u.q.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: E = None
        self.p: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: B = None
        self.u: D = None
        self.txt = txt

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

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

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

l = A("l")
m = B("m")
c = C("c")
n = D("n")
j = E("j")
a = F("a")

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