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

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.w: F = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.v: A = None
        self.o: A = None
        self.t: A = None
        self.y: B = None
        self.s: A = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
k = C("k")
m = D("m")
b = E("b")
l = F("l")
g = G("g")
a = A("a")

e.t = b
e.v = b
e.q = k
n.w = g
k.t = a
k.s = l
k.w = l
k.r = l
k.q = g
m.x = k
m.z = g
m.v = e
m.t = e
m.o = a
m.s = a
m.y = n
b.x = a
l.q = m
g.w = k
g.r = m
g.o = n
a.t = b
a.v = b
a.q = k
assert k.r.q.x.q.o.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: F = None
        self.w: F = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: G = None
        self.v: A = None
        self.o: A = None
        self.t: A = None
        self.y: B = None
        self.s: A = None
        self.txt = txt

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

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

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

e = A("e")
n = B("n")
k = C("k")
m = D("m")
b = E("b")
l = F("l")
g = G("g")
a = A("a")

e.t = b
e.v = b
e.q = k
n.w = g
k.t = a
k.s = l
k.w = l
k.r = l
k.q = g
m.x = k
m.z = g
m.v = e
m.t = e
m.o = a
m.s = a
m.y = n
b.x = a
l.q = m
g.w = k
g.r = m
g.o = n
a.t = b
a.v = b
a.q = k
assert k.r.q.x.q.o.w.w.w.txt == "l"