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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.q: D = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.u: D = None
        self.o: B = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: G = None
        self.q: D = None
        self.p: C = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: B = None
        self.u: D = None
        self.o: B = None
        self.v: F = None
        self.x: D = None
        self.txt = txt

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

i.q = m
g.z = l
g.v = e
g.r = e
g.x = k
k.w = l
k.y = g
k.u = c
c.v = l
c.w = e
m.v = c
m.q = c
m.s = c
m.o = e
m.p = k
l.x = c
l.o = g
e.r = c
e.u = c
e.x = c
e.y = g
e.o = g
e.v = l
assert g.r.x.v.o.r.txt == "e"