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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.w: E = None
        self.o: B = None
        self.y: E = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: D = None
        self.w: E = None
        self.o: B = None
        self.y: E = None
        self.s: A = None
        self.v: F = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.txt = txt

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

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