class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: E = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: E = None
        self.txt = txt

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

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

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