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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

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

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

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

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

e.s = f
e.q = g
e.r = j
l.v = c
c.s = k
c.q = l
j.p = f
k.z = g
k.u = g
k.v = j
k.t = j
k.r = c
k.q = c
k.o = l
g.w = k
g.u = j
f.u = e
f.o = c
assert e.r.p.u.q.txt == "g"