class A:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: H = None
        self.v: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: I = None
        self.v: F = None
        self.u: B = None
        self.o: E = None
        self.s: I = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: B = None
        self.r: I = None
        self.v: F = None
        self.u: B = None
        self.o: E = None
        self.s: I = None
        self.x: C = None
        self.w: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.q: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: B = None
        self.q: C = None
        self.v: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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