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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: H = None
        self.q: G = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.q: H = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: E = None
        self.p: G = None
        self.u: A = None
        self.txt = txt

h = A("h")
d = B("d")
m = C("m")
c = D("c")
l = E("l")
a = F("a")
k = G("k")
j = H("j")
e = H("e")
i = B("i")

h.o = i
d.w = e
d.p = l
m.w = d
m.u = h
c.x = m
c.o = j
c.q = k
c.r = i
c.w = a
l.z = a
l.r = d
l.q = e
l.v = h
l.o = m
a.r = h
k.v = a
k.p = c
k.z = c
j.w = k
j.p = k
j.y = l
j.u = h
e.w = k
e.p = k
e.y = l
e.u = h
i.w = j
i.p = l
assert i.p.v.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.o: H = None
        self.q: G = None
        self.r: B = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.r: B = None
        self.q: H = None
        self.v: A = None
        self.o: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: D = None
        self.z: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: G = None
        self.y: E = None
        self.p: G = None
        self.u: A = None
        self.txt = txt

h = A("h")
d = B("d")
m = C("m")
c = D("c")
l = E("l")
a = F("a")
k = G("k")
j = H("j")
e = H("e")
i = B("i")

h.o = i
d.w = e
d.p = l
m.w = d
m.u = h
c.x = m
c.o = j
c.q = k
c.r = i
c.w = a
l.z = a
l.r = d
l.q = e
l.v = h
l.o = m
a.r = h
k.v = a
k.p = c
k.z = c
j.w = k
j.p = k
j.y = l
j.u = h
e.w = k
e.p = k
e.y = l
e.u = h
i.w = j
i.p = l
assert i.p.v.o.w.txt == "j"