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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.p: G = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: A = None
        self.q: D = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.p: C = None
        self.x: D = None
        self.txt = txt

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

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

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

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