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

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

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

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

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

l = A("l")
m = B("m")
b = C("b")
c = D("c")
i = E("i")
j = A("j")
g = E("g")

l.s = g
l.v = j
l.r = b
l.x = m
l.z = c
m.z = g
m.t = c
b.v = i
b.t = g
b.u = m
c.w = g
c.z = i
i.u = g
i.p = g
i.s = c
i.x = c
j.s = i
j.v = l
j.r = b
j.x = m
j.z = c
g.u = i
g.p = i
g.s = c
g.x = c
assert l.z.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.v: A = None
        self.r: C = None
        self.x: B = None
        self.z: D = None
        self.txt = txt

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

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

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

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

l = A("l")
m = B("m")
b = C("b")
c = D("c")
i = E("i")
j = A("j")
g = E("g")

l.s = g
l.v = j
l.r = b
l.x = m
l.z = c
m.z = g
m.t = c
b.v = i
b.t = g
b.u = m
c.w = g
c.z = i
i.u = g
i.p = g
i.s = c
i.x = c
j.s = i
j.v = l
j.r = b
j.x = m
j.z = c
g.u = i
g.p = i
g.s = c
g.x = c
assert l.z.z.p.txt == "g"