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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.q: A = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: C = None
        self.u: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: D = None
        self.q: A = None
        self.x: E = None
        self.r: D = None
        self.txt = txt

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

d.v = k
d.p = i
h.t = i
h.w = e
h.o = g
i.z = d
i.y = e
i.q = g
i.v = g
g.v = i
g.o = i
g.u = f
a.s = d
a.p = g
a.r = g
a.q = k
a.x = e
c.s = d
c.q = d
c.p = g
c.r = g
c.x = a
f.t = i
f.w = e
f.o = g
k.v = d
k.p = i
e.s = d
e.p = g
e.r = g
e.q = k
e.x = a
b.t = i
b.w = e
b.o = g
assert h.w.q.v.v.txt == "k"