class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.u: E = None
        self.r: C = None
        self.z: E = None
        self.p: D = None
        self.v: E = None
        self.x: D = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: E = None
        self.u: E = None
        self.r: C = None
        self.z: E = None
        self.p: D = None
        self.v: E = None
        self.x: D = None
        self.s: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: B = None
        self.y: G = None
        self.v: G = None
        self.txt = txt

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

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

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