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

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

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

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

l = A("l")
k = B("k")
n = C("n")
e = D("e")
h = A("h")
b = C("b")
g = B("g")
f = B("f")

l.w = e
l.p = f
k.q = n
k.t = g
k.u = e
k.v = b
n.u = g
n.t = l
e.u = n
e.t = b
e.v = b
h.w = e
h.p = f
b.u = k
b.t = h
g.q = b
g.t = f
g.u = e
g.v = n
f.q = n
f.v = n
f.t = k
f.u = e
assert f.t.t.t.u.u.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.p: B = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
n = C("n")
e = D("e")
h = A("h")
b = C("b")
g = B("g")
f = B("f")

l.w = e
l.p = f
k.q = n
k.t = g
k.u = e
k.v = b
n.u = g
n.t = l
e.u = n
e.t = b
e.v = b
h.w = e
h.p = f
b.u = k
b.t = h
g.q = b
g.t = f
g.u = e
g.v = n
f.q = n
f.v = n
f.t = k
f.u = e
assert f.t.t.t.u.u.t.w.txt == "e"