class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: I = None
        self.x: D = None
        self.v: C = None
        self.o: I = None
        self.u: D = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.q: I = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: B = None
        self.t: D = None
        self.p: G = None
        self.y: D = None
        self.w: A = None
        self.u: C = None
        self.v: H = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.q: A = None
        self.s: B = None
        self.z: F = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: G = None
        self.o: A = None
        self.r: G = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: F = None
        self.y: F = None
        self.z: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: A = None
        self.q: I = None
        self.p: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.z: B = None
        self.t: D = None
        self.p: G = None
        self.y: D = None
        self.w: A = None
        self.u: C = None
        self.v: H = None
        self.q: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.w: D = None
        self.q: A = None
        self.s: B = None
        self.z: F = None
        self.r: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: G = None
        self.o: A = None
        self.r: G = None
        self.s: E = None
        self.txt = txt

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

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