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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.u: C = None
        self.w: H = None
        self.s: G = None
        self.t: H = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: I = None
        self.w: I = None
        self.z: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.u: C = None
        self.w: H = None
        self.s: G = None
        self.t: H = None
        self.z: C = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: H = None
        self.v: I = None
        self.w: I = None
        self.z: I = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

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

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

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

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