class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.u: H = None
        self.z: G = None
        self.q: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: H = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.z: G = None
        self.r: A = None
        self.x: A = None
        self.w: H = None
        self.y: H = None
        self.t: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.r: H = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.u: A = None
        self.z: G = None
        self.r: A = None
        self.x: A = None
        self.w: H = None
        self.y: H = None
        self.t: A = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.p: B = None
        self.o: A = None
        self.txt = txt

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

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

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