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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.z: G = None
        self.t: A = None
        self.s: F = None
        self.y: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.r: E = None
        self.q: A = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: F = None
        self.z: G = None
        self.t: A = None
        self.s: F = None
        self.y: E = None
        self.o: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.p: F = None
        self.r: E = None
        self.q: A = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: C = None
        self.p: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

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

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