class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
n = C("n")
j = D("j")
a = E("a")
c = A("c")
e = E("e")
i = B("i")
b = E("b")
k = C("k")

f.v = n
h.y = a
h.p = i
h.w = c
h.o = j
n.y = h
n.t = k
j.s = h
j.w = f
a.y = b
a.r = b
a.z = f
a.w = j
c.v = k
e.y = b
e.z = f
e.r = a
e.w = j
i.y = a
i.p = h
i.w = c
i.o = j
b.y = e
b.r = e
b.z = c
b.w = j
k.y = h
k.t = n
assert a.z.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

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

f = A("f")
h = B("h")
n = C("n")
j = D("j")
a = E("a")
c = A("c")
e = E("e")
i = B("i")
b = E("b")
k = C("k")

f.v = n
h.y = a
h.p = i
h.w = c
h.o = j
n.y = h
n.t = k
j.s = h
j.w = f
a.y = b
a.r = b
a.z = f
a.w = j
c.v = k
e.y = b
e.z = f
e.r = a
e.w = j
i.y = a
i.p = h
i.w = c
i.o = j
b.y = e
b.r = e
b.z = c
b.w = j
k.y = h
k.t = n
assert a.z.v.t.txt == "k"