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

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

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

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

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

l.r = k
l.t = k
l.x = k
l.y = a
h.w = f
h.x = f
h.r = f
h.v = a
a.v = f
f.y = k
n.r = k
n.t = k
n.x = h
n.y = a
e.r = h
e.t = k
e.x = k
e.y = a
k.w = f
k.x = f
k.r = f
k.v = a
assert n.t.w.y.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.x: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

l.r = k
l.t = k
l.x = k
l.y = a
h.w = f
h.x = f
h.r = f
h.v = a
a.v = f
f.y = k
n.r = k
n.t = k
n.x = h
n.y = a
e.r = h
e.t = k
e.x = k
e.y = a
k.w = f
k.x = f
k.r = f
k.v = a
assert n.t.w.y.v.txt == "a"