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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.t: A = None
        self.z: G = None
        self.y: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.u: C = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: B = None
        self.t: A = None
        self.z: G = None
        self.y: E = None
        self.v: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: E = None
        self.y: B = None
        self.u: C = None
        self.r: E = None
        self.o: B = None
        self.txt = txt

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

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