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

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

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

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

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

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

b = A("b")
m = B("m")
j = C("j")
i = D("i")
l = E("l")
k = F("k")

b.z = l
b.r = l
m.x = l
m.u = l
m.v = j
m.o = i
m.q = i
m.p = b
j.x = b
j.u = l
j.s = k
j.p = m
j.q = m
i.z = k
l.u = i
k.u = i
k.o = l
assert k.o.u.z.u.z.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

b = A("b")
m = B("m")
j = C("j")
i = D("i")
l = E("l")
k = F("k")

b.z = l
b.r = l
m.x = l
m.u = l
m.v = j
m.o = i
m.q = i
m.p = b
j.x = b
j.u = l
j.s = k
j.p = m
j.q = m
i.z = k
l.u = i
k.u = i
k.o = l
assert k.o.u.z.u.z.o.txt == "l"