class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

j = A("j")
g = B("g")
a = C("a")
f = D("f")
m = E("m")
k = E("k")
e = C("e")
i = C("i")

j.y = m
j.p = f
g.y = f
g.w = j
g.x = j
g.v = j
a.w = m
a.v = g
a.t = f
a.z = f
a.s = j
f.t = m
f.y = j
f.z = g
m.q = f
k.q = f
e.w = m
e.v = g
e.t = f
e.z = f
e.s = j
i.w = k
i.v = g
i.t = f
i.z = f
i.s = j
assert i.s.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.txt = txt

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

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

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

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

j = A("j")
g = B("g")
a = C("a")
f = D("f")
m = E("m")
k = E("k")
e = C("e")
i = C("i")

j.y = m
j.p = f
g.y = f
g.w = j
g.x = j
g.v = j
a.w = m
a.v = g
a.t = f
a.z = f
a.s = j
f.t = m
f.y = j
f.z = g
m.q = f
k.q = f
e.w = m
e.v = g
e.t = f
e.z = f
e.s = j
i.w = k
i.v = g
i.t = f
i.z = f
i.s = j
assert i.s.p.z.txt == "g"