class A:
    def __init__(self, txt: str):
        self.p: I = None
        self.o: C = None
        self.y: B = None
        self.r: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.t: A = None
        self.p: I = None
        self.r: A = None
        self.u: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: C = None
        self.t: C = None
        self.w: A = None
        self.s: B = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.o: E = None
        self.t: A = None
        self.p: I = None
        self.r: A = None
        self.u: C = None
        self.q: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: C = None
        self.z: A = None
        self.w: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.v: C = None
        self.t: C = None
        self.w: A = None
        self.s: B = None
        self.o: D = None
        self.y: D = None
        self.txt = txt

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

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

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