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

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

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

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

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

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

d.t = n
a.q = l
a.r = e
a.o = h
a.v = d
a.p = d
g.v = i
k.t = d
k.o = e
k.q = l
f.t = e
f.w = d
e.t = d
e.o = k
e.q = l
l.q = a
l.r = k
l.o = h
l.v = d
l.p = d
i.v = g
h.t = k
h.w = d
n.v = i
assert a.o.w.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

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

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

d.t = n
a.q = l
a.r = e
a.o = h
a.v = d
a.p = d
g.v = i
k.t = d
k.o = e
k.q = l
f.t = e
f.w = d
e.t = d
e.o = k
e.q = l
l.q = a
l.r = k
l.o = h
l.v = d
l.p = d
i.v = g
h.t = k
h.w = d
n.v = i
assert a.o.w.t.v.txt == "i"