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

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

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

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

j = A("j")
l = B("l")
c = C("c")
n = D("n")
m = A("m")
f = C("f")
h = D("h")
i = A("i")

j.w = c
j.q = c
j.z = h
j.y = l
l.y = f
l.x = m
l.o = i
c.v = n
c.w = l
n.s = c
n.w = c
m.w = f
m.q = c
m.z = n
m.y = l
f.v = h
f.w = l
h.s = f
h.w = f
i.w = f
i.q = c
i.z = n
i.y = l
assert f.w.o.y.y.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.q: C = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

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

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

j = A("j")
l = B("l")
c = C("c")
n = D("n")
m = A("m")
f = C("f")
h = D("h")
i = A("i")

j.w = c
j.q = c
j.z = h
j.y = l
l.y = f
l.x = m
l.o = i
c.v = n
c.w = l
n.s = c
n.w = c
m.w = f
m.q = c
m.z = n
m.y = l
f.v = h
f.w = l
h.s = f
h.w = f
i.w = f
i.q = c
i.z = n
i.y = l
assert f.w.o.y.y.w.y.txt == "f"