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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: H = None
        self.u: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: H = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: D = None
        self.r: C = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: H = None
        self.r: F = None
        self.s: B = None
        self.u: H = None
        self.o: H = None
        self.y: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: C = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.s: H = None
        self.u: E = None
        self.r: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: H = None
        self.w: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.w: A = None
        self.z: E = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.q: D = None
        self.r: C = None
        self.s: B = None
        self.x: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: H = None
        self.r: F = None
        self.s: B = None
        self.u: H = None
        self.o: H = None
        self.y: A = None
        self.w: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.q: C = None
        self.u: C = None
        self.txt = txt

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

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