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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: B = None
        self.w: F = None
        self.y: F = None
        self.r: A = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: G = None
        self.v: I = None
        self.u: I = None
        self.x: E = None
        self.s: G = None
        self.q: E = None
        self.txt = txt

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

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

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

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

a.z = j
a.x = c
a.w = i
a.u = e
a.r = k
n.u = e
n.q = i
n.y = a
n.r = a
k.u = g
k.o = e
e.p = i
e.w = i
e.y = i
e.z = n
e.x = n
e.r = a
j.r = d
i.w = a
i.o = c
i.s = c
i.v = m
i.u = m
i.x = j
i.q = j
c.q = n
c.o = a
c.w = a
c.u = d
c.v = i
c.r = k
g.u = m
g.r = e
g.s = e
g.p = d
m.q = c
m.u = g
d.z = j
d.x = c
d.w = i
d.u = e
d.r = k
assert k.o.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: G = None
        self.w: F = None
        self.u: D = None
        self.r: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: F = None
        self.y: A = None
        self.r: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.z: B = None
        self.w: F = None
        self.y: F = None
        self.r: A = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: G = None
        self.v: I = None
        self.u: I = None
        self.x: E = None
        self.s: G = None
        self.q: E = None
        self.txt = txt

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

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

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

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

a.z = j
a.x = c
a.w = i
a.u = e
a.r = k
n.u = e
n.q = i
n.y = a
n.r = a
k.u = g
k.o = e
e.p = i
e.w = i
e.y = i
e.z = n
e.x = n
e.r = a
j.r = d
i.w = a
i.o = c
i.s = c
i.v = m
i.u = m
i.x = j
i.q = j
c.q = n
c.o = a
c.w = a
c.u = d
c.v = i
c.r = k
g.u = m
g.r = e
g.s = e
g.p = d
m.q = c
m.u = g
d.z = j
d.x = c
d.w = i
d.u = e
d.r = k
assert k.o.w.u.txt == "m"