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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.v: B = None
        self.x: G = None
        self.w: B = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.s: B = None
        self.y: D = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.t: E = None
        self.v: B = None
        self.x: G = None
        self.w: B = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.s: B = None
        self.y: D = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

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

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