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

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.o: E = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
n = C("n")
c = D("c")
i = E("i")
e = B("e")

h.o = i
h.p = i
h.t = c
h.w = c
j.x = c
j.y = n
j.v = i
j.t = i
n.p = h
n.u = h
n.y = e
n.o = i
n.v = i
c.w = n
i.x = n
i.w = n
e.x = c
e.y = n
e.v = i
e.t = i
assert i.x.o.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.w: D = None
        self.p: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: B = None
        self.o: E = None
        self.u: A = None
        self.v: E = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
n = C("n")
c = D("c")
i = E("i")
e = B("e")

h.o = i
h.p = i
h.t = c
h.w = c
j.x = c
j.y = n
j.v = i
j.t = i
n.p = h
n.u = h
n.y = e
n.o = i
n.v = i
c.w = n
i.x = n
i.w = n
e.x = c
e.y = n
e.v = i
e.t = i
assert i.x.o.w.y.txt == "e"