class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: B = None
        self.s: E = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.s: C = None
        self.z: E = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.x: A = None
        self.s: B = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

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

m.q = a
m.w = a
m.p = l
m.t = k
a.r = l
n.z = h
n.r = a
d.o = k
d.t = a
d.u = a
d.s = l
d.w = n
l.z = k
l.u = n
l.o = a
l.r = a
l.x = d
k.q = l
k.z = l
k.p = l
k.x = h
k.s = n
k.w = n
h.q = l
h.r = k
h.p = k
h.x = m
h.s = a
h.u = d
assert l.u.z.u.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: E = None
        self.t: F = None
        self.w: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.t: B = None
        self.s: E = None
        self.w: C = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: G = None
        self.s: C = None
        self.z: E = None
        self.w: C = None
        self.p: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.r: F = None
        self.x: A = None
        self.s: B = None
        self.p: F = None
        self.u: D = None
        self.txt = txt

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

m.q = a
m.w = a
m.p = l
m.t = k
a.r = l
n.z = h
n.r = a
d.o = k
d.t = a
d.u = a
d.s = l
d.w = n
l.z = k
l.u = n
l.o = a
l.r = a
l.x = d
k.q = l
k.z = l
k.p = l
k.x = h
k.s = n
k.w = n
h.q = l
h.r = k
h.p = k
h.x = m
h.s = a
h.u = d
assert l.u.z.u.t.r.txt == "l"