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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: G = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.u: D = None
        self.s: B = None
        self.y: E = None
        self.txt = txt

c = A("c")
e = B("e")
l = C("l")
i = D("i")
m = E("m")
k = F("k")
h = G("h")
b = C("b")

c.q = m
c.o = k
c.y = k
e.p = c
e.x = h
e.q = h
e.y = i
l.q = c
i.r = k
i.t = k
i.z = k
i.y = b
i.u = l
i.q = l
i.w = e
m.x = h
m.u = k
m.q = c
m.p = e
k.q = e
h.x = l
h.r = m
h.y = m
h.u = i
h.s = e
b.q = c
assert m.p.q.y.p.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: F = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.x: G = None
        self.q: G = None
        self.y: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: E = None
        self.u: D = None
        self.s: B = None
        self.y: E = None
        self.txt = txt

c = A("c")
e = B("e")
l = C("l")
i = D("i")
m = E("m")
k = F("k")
h = G("h")
b = C("b")

c.q = m
c.o = k
c.y = k
e.p = c
e.x = h
e.q = h
e.y = i
l.q = c
i.r = k
i.t = k
i.z = k
i.y = b
i.u = l
i.q = l
i.w = e
m.x = h
m.u = k
m.q = c
m.p = e
k.q = e
h.x = l
h.r = m
h.y = m
h.u = i
h.s = e
b.q = c
assert m.p.q.y.p.p.q.u.txt == "k"