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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.w: A = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
l = D("l")
f = E("f")
d = F("d")
j = G("j")
e = C("e")

a.o = l
a.v = l
n.v = l
n.u = g
g.o = d
l.y = n
l.w = f
l.u = j
l.q = j
l.t = d
l.x = e
f.t = l
f.q = j
f.v = n
f.w = g
d.z = j
d.q = j
d.y = f
d.t = e
d.x = e
d.r = n
d.w = l
j.q = a
j.w = a
j.p = a
j.o = d
j.u = d
e.o = d
assert g.o.t.o.x.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.o: F = None
        self.w: A = None
        self.u: F = None
        self.p: A = None
        self.txt = txt

a = A("a")
n = B("n")
g = C("g")
l = D("l")
f = E("f")
d = F("d")
j = G("j")
e = C("e")

a.o = l
a.v = l
n.v = l
n.u = g
g.o = d
l.y = n
l.w = f
l.u = j
l.q = j
l.t = d
l.x = e
f.t = l
f.q = j
f.v = n
f.w = g
d.z = j
d.q = j
d.y = f
d.t = e
d.x = e
d.r = n
d.w = l
j.q = a
j.w = a
j.p = a
j.o = d
j.u = d
e.o = d
assert g.o.t.o.x.txt == "e"