class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: C = None
        self.t: F = None
        self.p: D = None
        self.o: F = None
        self.s: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: D = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: F = None
        self.t: E = None
        self.o: H = None
        self.q: H = None
        self.w: E = None
        self.v: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: D = None
        self.w: D = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.s: F = None
        self.t: E = None
        self.o: H = None
        self.q: H = None
        self.w: E = None
        self.v: G = None
        self.txt = txt

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

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