class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: C = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: A = None
        self.q: A = None
        self.z: B = None
        self.t: F = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: F = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: F = None
        self.p: F = None
        self.z: G = None
        self.u: A = None
        self.o: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.u: A = None
        self.q: A = None
        self.z: B = None
        self.t: F = None
        self.x: A = None
        self.v: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.x: F = None
        self.t: A = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: A = None
        self.s: F = None
        self.p: F = None
        self.z: G = None
        self.u: A = None
        self.o: F = None
        self.txt = txt

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

d.p = j
d.v = h
d.w = h
n.r = h
n.p = k
h.p = d
h.u = d
h.q = d
h.x = d
h.z = n
h.t = j
h.v = c
g.v = c
g.q = n
c.q = k
c.x = j
c.t = d
c.y = g
j.r = n
j.y = d
j.w = d
k.v = d
k.u = d
k.s = j
k.p = j
k.o = j
k.z = a
a.v = d
a.u = d
a.s = j
a.p = j
a.o = j
a.z = k
assert j.r.p.v.p.w.p.y.w.txt == "h"