class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.o: F = None
        self.r: G = None
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: H = None
        self.p: D = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: G = None
        self.y: G = None
        self.v: H = None
        self.q: C = None
        self.r: G = None
        self.u: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: H = None
        self.p: D = None
        self.x: A = None
        self.v: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: A = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: H = None
        self.t: G = None
        self.y: G = None
        self.v: H = None
        self.q: C = None
        self.r: G = None
        self.u: G = None
        self.x: B = None
        self.txt = txt

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

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

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

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

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