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

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

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

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

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

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

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

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

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

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

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

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

l.p = i
l.t = f
l.y = h
l.w = g
g.z = h
g.v = i
g.w = f
g.s = f
h.r = l
h.w = l
h.q = i
h.t = g
h.z = f
i.q = g
i.v = l
f.z = l
f.p = i
f.y = g
assert i.v.t.y.w.txt == "f"