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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: D = None
        self.txt = txt

i = A("i")
a = B("a")
h = C("h")
j = D("j")
n = E("n")
c = F("c")
m = G("m")
b = H("b")
k = C("k")

i.w = a
a.x = m
h.o = i
h.t = n
j.s = m
n.x = j
n.r = b
n.v = h
c.q = j
c.o = j
c.u = n
m.r = h
m.o = a
m.q = i
m.y = n
m.t = c
m.x = j
b.r = c
b.o = j
k.o = i
k.t = n
assert h.t.r.r.q.s.r.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.o: D = None
        self.txt = txt

i = A("i")
a = B("a")
h = C("h")
j = D("j")
n = E("n")
c = F("c")
m = G("m")
b = H("b")
k = C("k")

i.w = a
a.x = m
h.o = i
h.t = n
j.s = m
n.x = j
n.r = b
n.v = h
c.q = j
c.o = j
c.u = n
m.r = h
m.o = a
m.q = i
m.y = n
m.t = c
m.x = j
b.r = c
b.o = j
k.o = i
k.t = n
assert h.t.r.r.q.s.r.t.v.txt == "h"