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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: H = None
        self.x: D = None
        self.z: H = None
        self.s: A = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: A = None
        self.w: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.u: H = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

k = A("k")
n = B("n")
f = C("f")
h = D("h")
j = E("j")
l = F("l")
c = G("c")
m = H("m")
g = H("g")

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: H = None
        self.x: D = None
        self.z: H = None
        self.s: A = None
        self.o: E = None
        self.u: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: A = None
        self.w: H = None
        self.x: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.z: E = None
        self.u: H = None
        self.y: E = None
        self.t: B = None
        self.txt = txt

k = A("k")
n = B("n")
f = C("f")
h = D("h")
j = E("j")
l = F("l")
c = G("c")
m = H("m")
g = H("g")

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