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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: A = None
        self.s: I = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: D = None
        self.v: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: D = None
        self.y: C = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.w: A = None
        self.s: I = None
        self.txt = txt

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

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

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