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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.s: A = None
        self.o: G = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

d = A("d")
c = B("c")
a = C("a")
k = D("k")
e = E("e")
j = F("j")
m = G("m")
l = B("l")

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.s: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.q: A = None
        self.s: A = None
        self.o: G = None
        self.u: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

d = A("d")
c = B("c")
a = C("a")
k = D("k")
e = E("e")
j = F("j")
m = G("m")
l = B("l")

d.q = e
c.o = j
c.p = l
a.t = k
a.u = k
a.y = k
a.p = j
a.o = l
k.w = m
k.s = e
e.z = k
e.y = l
e.t = d
e.p = d
e.r = d
e.x = m
e.s = m
j.x = d
j.q = d
j.s = d
j.o = m
j.u = a
m.s = j
l.o = j
l.p = c
assert m.s.q.q.z.w.s.u.o.txt == "l"