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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.y: B = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.y: B = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

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

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