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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.w: I = None
        self.y: I = None
        self.v: G = None
        self.x: G = None
        self.o: G = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: A = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.r: F = None
        self.w: F = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: G = None
        self.w: I = None
        self.y: I = None
        self.v: G = None
        self.x: G = None
        self.o: G = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.q: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: I = None
        self.q: A = None
        self.w: D = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.v: B = None
        self.s: H = None
        self.r: F = None
        self.w: F = None
        self.txt = txt

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

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