class A:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: B = None
        self.o: G = None
        self.p: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: C = None
        self.w: A = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.r: A = None
        self.y: B = None
        self.w: G = None
        self.p: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: C = None
        self.w: A = None
        self.q: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.t: G = None
        self.r: A = None
        self.y: B = None
        self.w: G = None
        self.p: F = None
        self.u: F = None
        self.txt = txt

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

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

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

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