class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: A = None
        self.z: D = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.x: A = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: C = None
        self.w: D = None
        self.u: D = None
        self.t: B = None
        self.z: C = None
        self.y: C = None
        self.txt = txt

l = A("l")
c = B("c")
d = C("d")
a = D("a")
i = E("i")
m = F("m")
f = G("f")

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: A = None
        self.z: D = None
        self.t: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: F = None
        self.x: A = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: C = None
        self.w: D = None
        self.u: D = None
        self.t: B = None
        self.z: C = None
        self.y: C = None
        self.txt = txt

l = A("l")
c = B("c")
d = C("d")
a = D("a")
i = E("i")
m = F("m")
f = G("f")

l.o = i
l.y = c
c.z = m
c.y = m
c.r = l
c.v = l
c.x = d
c.s = a
c.u = a
d.s = a
d.z = a
d.v = l
d.t = m
a.p = c
a.o = i
a.y = d
i.z = c
i.p = m
i.x = l
i.v = a
m.p = f
m.u = f
m.x = l
m.w = l
m.q = c
m.o = d
f.r = a
f.w = a
f.u = a
f.p = d
f.z = d
f.y = d
f.t = c
assert m.u.p.s.y.txt == "d"