class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.v: G = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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