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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.p: A = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
e = C("e")
l = D("l")
g = E("g")
h = B("h")
c = D("c")
i = E("i")

k.p = l
k.w = f
f.y = g
f.r = h
f.x = c
e.w = i
e.r = g
e.p = k
l.s = e
l.r = g
l.t = g
l.w = h
l.q = k
g.p = e
g.y = k
g.s = k
g.v = k
g.q = k
h.y = i
h.r = f
h.x = l
c.s = e
c.r = g
c.t = g
c.w = f
c.q = k
i.p = e
i.y = k
i.s = k
i.v = k
i.q = k
assert h.x.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.w: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: E = None
        self.p: A = None
        self.txt = txt

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

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

k = A("k")
f = B("f")
e = C("e")
l = D("l")
g = E("g")
h = B("h")
c = D("c")
i = E("i")

k.p = l
k.w = f
f.y = g
f.r = h
f.x = c
e.w = i
e.r = g
e.p = k
l.s = e
l.r = g
l.t = g
l.w = h
l.q = k
g.p = e
g.y = k
g.s = k
g.v = k
g.q = k
h.y = i
h.r = f
h.x = l
c.s = e
c.r = g
c.t = g
c.w = f
c.q = k
i.p = e
i.y = k
i.s = k
i.v = k
i.q = k
assert h.x.s.p.txt == "k"