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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: H = None
        self.r: G = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.v: H = None
        self.r: G = None
        self.u: H = None
        self.o: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

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

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

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