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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: C = None
        self.u: E = None
        self.p: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: F = None
        self.t: E = None
        self.z: D = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: D = None
        self.z: C = None
        self.u: E = None
        self.p: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.q: F = None
        self.t: E = None
        self.z: D = None
        self.s: F = None
        self.o: E = None
        self.txt = txt

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

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