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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.o: F = None
        self.z: E = None
        self.q: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: G = None
        self.o: F = None
        self.z: E = None
        self.q: D = None
        self.t: G = None
        self.txt = txt

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

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

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

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

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

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

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