class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.v: A = None
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: C = None
        self.t: A = None
        self.v: A = None
        self.x: A = None
        self.o: B = None
        self.txt = txt

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

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

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