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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.t: F = None
        self.s: A = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.r: J = None
        self.z: H = None
        self.p: H = None
        self.w: H = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: I = None
        self.r: H = None
        self.u: C = None
        self.y: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: B = None
        self.v: E = None
        self.z: A = None
        self.w: H = None
        self.t: C = None
        self.q: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.x: C = None
        self.t: F = None
        self.s: A = None
        self.w: C = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.r: J = None
        self.z: H = None
        self.p: H = None
        self.w: H = None
        self.s: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.w: I = None
        self.r: H = None
        self.u: C = None
        self.y: B = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.y: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.r: I = None
        self.u: B = None
        self.v: E = None
        self.z: A = None
        self.w: H = None
        self.t: C = None
        self.q: A = None
        self.txt = txt

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

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