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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.s: E = None
        self.w: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

n = A("n")
c = B("c")
i = C("i")
j = D("j")
k = E("k")
g = F("g")
d = G("d")
m = A("m")
b = B("b")
f = D("f")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: B = None
        self.s: E = None
        self.w: D = None
        self.z: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.s: B = None
        self.txt = txt

n = A("n")
c = B("c")
i = C("i")
j = D("j")
k = E("k")
g = F("g")
d = G("d")
m = A("m")
b = B("b")
f = D("f")

n.r = k
c.o = b
c.s = g
c.z = m
i.z = f
i.o = b
j.w = g
j.t = c
j.x = i
k.v = i
k.t = i
k.q = i
k.r = i
k.u = g
k.o = g
k.s = d
g.q = j
g.w = j
g.v = c
g.s = k
g.z = d
d.r = c
d.p = k
d.s = b
m.r = k
b.o = c
b.s = g
b.z = m
f.w = g
f.t = c
f.x = i
assert n.r.o.z.txt == "d"