class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: B = None
        self.r: B = None
        self.y: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

g.x = e
g.t = e
g.o = n
d.o = n
d.r = a
d.p = a
d.w = a
d.q = m
d.v = i
d.s = b
i.r = e
i.v = n
i.t = n
m.p = n
m.w = a
a.q = d
a.y = d
a.z = n
e.s = i
e.y = a
e.o = g
e.q = g
n.z = a
n.t = d
n.r = d
n.y = m
n.q = b
n.s = e
b.r = e
b.v = n
b.t = n
assert d.o.q.v.t.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: G = None
        self.t: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: B = None
        self.z: G = None
        self.y: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.z: E = None
        self.t: B = None
        self.r: B = None
        self.y: D = None
        self.q: C = None
        self.s: F = None
        self.txt = txt

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

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