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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

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

n = A("n")
l = B("l")
f = C("f")
k = D("k")
b = E("b")
h = A("h")
i = C("i")
j = E("j")

n.x = f
n.v = f
l.x = b
l.t = b
f.w = l
f.p = n
f.o = n
k.w = l
k.y = i
b.w = h
h.x = f
h.v = i
i.w = l
i.p = n
i.o = h
j.w = h
assert j.w.x.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

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

n = A("n")
l = B("l")
f = C("f")
k = D("k")
b = E("b")
h = A("h")
i = C("i")
j = E("j")

n.x = f
n.v = f
l.x = b
l.t = b
f.w = l
f.p = n
f.o = n
k.w = l
k.y = i
b.w = h
h.x = f
h.v = i
i.w = l
i.p = n
i.o = h
j.w = h
assert j.w.x.w.txt == "l"