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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

i = A("i")
f = B("f")
d = C("d")
a = D("a")
l = E("l")
h = F("h")
g = G("g")
j = C("j")
n = E("n")

i.p = a
i.z = h
f.p = a
d.z = f
d.x = h
d.p = h
d.y = h
a.p = g
a.v = g
a.s = i
a.t = i
a.z = l
l.q = i
l.x = j
l.u = f
l.r = a
l.v = a
h.t = g
g.y = n
g.p = l
g.v = l
g.r = a
g.s = h
g.w = f
j.z = f
j.x = h
j.p = h
j.y = h
n.q = i
n.x = d
n.u = f
n.r = a
n.v = a
assert a.v.w.p.t.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: G = None
        self.txt = txt

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

i = A("i")
f = B("f")
d = C("d")
a = D("a")
l = E("l")
h = F("h")
g = G("g")
j = C("j")
n = E("n")

i.p = a
i.z = h
f.p = a
d.z = f
d.x = h
d.p = h
d.y = h
a.p = g
a.v = g
a.s = i
a.t = i
a.z = l
l.q = i
l.x = j
l.u = f
l.r = a
l.v = a
h.t = g
g.y = n
g.p = l
g.v = l
g.r = a
g.s = h
g.w = f
j.z = f
j.x = h
j.p = h
j.y = h
n.q = i
n.x = d
n.u = f
n.r = a
n.v = a
assert a.v.w.p.t.p.p.txt == "g"