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

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

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

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

a = A("a")
l = B("l")
c = C("c")
k = D("k")
j = B("j")
i = C("i")
g = B("g")
h = D("h")

a.t = h
a.p = k
a.o = k
a.v = j
l.v = g
l.w = j
l.q = k
l.x = a
c.p = k
c.w = i
c.o = a
k.w = a
j.v = l
j.w = l
j.q = k
j.x = a
i.p = h
i.w = c
i.o = a
g.v = j
g.w = l
g.q = k
g.x = a
h.w = a
assert a.t.w.t.w.t.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.p: D = None
        self.o: D = None
        self.v: B = None
        self.txt = txt

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

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

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

a = A("a")
l = B("l")
c = C("c")
k = D("k")
j = B("j")
i = C("i")
g = B("g")
h = D("h")

a.t = h
a.p = k
a.o = k
a.v = j
l.v = g
l.w = j
l.q = k
l.x = a
c.p = k
c.w = i
c.o = a
k.w = a
j.v = l
j.w = l
j.q = k
j.x = a
i.p = h
i.w = c
i.o = a
g.v = j
g.w = l
g.q = k
g.x = a
h.w = a
assert a.t.w.t.w.t.w.o.txt == "k"