class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.q: B = None
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.t: B = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

n = A("n")
i = B("i")
g = C("g")
b = D("b")
e = E("e")
f = E("f")
l = B("l")
d = B("d")
m = C("m")
c = A("c")

n.p = f
n.x = e
n.q = d
n.v = d
n.w = g
i.v = l
i.y = f
g.p = f
g.v = n
g.t = l
g.s = m
g.z = i
b.t = f
e.s = d
f.s = l
l.v = i
l.y = e
d.v = i
d.y = e
m.p = e
m.v = n
m.t = i
m.z = i
m.s = g
c.p = f
c.x = e
c.q = d
c.v = l
c.w = m
assert n.p.s.y.s.y.s.v.y.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: E = None
        self.q: B = None
        self.v: B = None
        self.w: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.v: A = None
        self.t: B = None
        self.s: C = None
        self.z: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

n = A("n")
i = B("i")
g = C("g")
b = D("b")
e = E("e")
f = E("f")
l = B("l")
d = B("d")
m = C("m")
c = A("c")

n.p = f
n.x = e
n.q = d
n.v = d
n.w = g
i.v = l
i.y = f
g.p = f
g.v = n
g.t = l
g.s = m
g.z = i
b.t = f
e.s = d
f.s = l
l.v = i
l.y = e
d.v = i
d.y = e
m.p = e
m.v = n
m.t = i
m.z = i
m.s = g
c.p = f
c.x = e
c.q = d
c.v = l
c.w = m
assert n.p.s.y.s.y.s.v.y.s.v.txt == "i"