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

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

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

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

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

k = A("k")
j = B("j")
l = C("l")
c = D("c")
h = E("h")
n = E("n")

k.o = c
j.v = h
j.x = h
j.z = c
l.y = h
l.x = c
l.o = k
c.v = j
c.t = l
c.w = h
h.t = c
h.v = l
h.z = j
n.t = c
n.v = l
n.z = j
assert c.t.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

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

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

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

k = A("k")
j = B("j")
l = C("l")
c = D("c")
h = E("h")
n = E("n")

k.o = c
j.v = h
j.x = h
j.z = c
l.y = h
l.x = c
l.o = k
c.v = j
c.t = l
c.w = h
h.t = c
h.v = l
h.z = j
n.t = c
n.v = l
n.z = j
assert c.t.x.v.txt == "j"