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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.y: H = None
        self.p: G = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.q: B = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: F = None
        self.z: C = None
        self.y: E = None
        self.p: B = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.y: H = None
        self.p: G = None
        self.x: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.q: B = None
        self.o: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: F = None
        self.z: C = None
        self.y: E = None
        self.p: B = None
        self.x: C = None
        self.s: A = None
        self.txt = txt

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

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