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

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

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

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

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

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

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

g = A("g")
l = B("l")
m = C("m")
f = D("f")
j = E("j")
k = F("k")
b = G("b")
h = G("h")
e = G("e")

g.z = h
g.r = f
l.q = m
l.u = m
l.x = k
l.w = k
l.r = f
l.y = g
m.p = j
m.q = j
m.s = j
m.r = l
f.r = m
f.x = m
f.q = j
f.s = l
j.r = l
k.q = m
b.y = j
b.o = l
b.p = l
b.u = g
b.t = f
b.s = m
b.v = e
h.y = j
h.o = l
h.p = l
h.u = g
h.t = f
h.s = m
h.v = e
e.y = j
e.o = l
e.p = l
e.u = g
e.t = f
e.s = m
e.v = h
assert m.q.r.w.q.r.y.z.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

g = A("g")
l = B("l")
m = C("m")
f = D("f")
j = E("j")
k = F("k")
b = G("b")
h = G("h")
e = G("e")

g.z = h
g.r = f
l.q = m
l.u = m
l.x = k
l.w = k
l.r = f
l.y = g
m.p = j
m.q = j
m.s = j
m.r = l
f.r = m
f.x = m
f.q = j
f.s = l
j.r = l
k.q = m
b.y = j
b.o = l
b.p = l
b.u = g
b.t = f
b.s = m
b.v = e
h.y = j
h.o = l
h.p = l
h.u = g
h.t = f
h.s = m
h.v = e
e.y = j
e.o = l
e.p = l
e.u = g
e.t = f
e.s = m
e.v = h
assert m.q.r.w.q.r.y.z.v.txt == "e"