class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

n = A("n")
g = B("g")
c = C("c")
l = D("l")
f = E("f")
a = F("a")
m = G("m")
e = G("e")
j = G("j")

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: C = None
        self.z: B = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

n = A("n")
g = B("g")
c = C("c")
l = D("l")
f = E("f")
a = F("a")
m = G("m")
e = G("e")
j = G("j")

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