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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.p: E = None
        self.t: D = None
        self.z: I = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.o: H = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.z: E = None
        self.r: A = None
        self.o: F = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: H = None
        self.w: I = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: F = None
        self.z: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: G = None
        self.p: E = None
        self.t: D = None
        self.z: I = None
        self.s: C = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: E = None
        self.o: H = None
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.v: G = None
        self.w: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: I = None
        self.z: E = None
        self.r: A = None
        self.o: F = None
        self.w: F = None
        self.u: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: H = None
        self.w: I = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: F = None
        self.z: F = None
        self.txt = txt

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

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