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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: E = None
        self.z: A = None
        self.s: F = None
        self.u: B = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

l.x = j
j.v = i
m.p = g
m.r = g
m.t = e
m.o = j
i.o = j
i.p = j
i.t = j
i.w = l
i.v = l
a.w = e
a.z = e
a.q = j
e.o = j
e.u = i
g.p = l
g.z = l
g.o = l
g.t = a
g.s = e
g.u = j
g.x = j
assert j.v.v.x.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: E = None
        self.z: A = None
        self.s: F = None
        self.u: B = None
        self.x: B = None
        self.o: A = None
        self.txt = txt

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

l.x = j
j.v = i
m.p = g
m.r = g
m.t = e
m.o = j
i.o = j
i.p = j
i.t = j
i.w = l
i.v = l
a.w = e
a.z = e
a.q = j
e.o = j
e.u = i
g.p = l
g.z = l
g.o = l
g.t = a
g.s = e
g.u = j
g.x = j
assert j.v.v.x.v.p.txt == "j"