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

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

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

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

l = A("l")
f = B("f")
i = C("i")
j = D("j")
b = D("b")
e = C("e")
h = C("h")
a = C("a")
k = C("k")

l.z = h
l.o = f
l.w = b
l.s = b
f.s = a
f.r = l
f.t = h
i.q = l
i.w = l
i.z = a
j.v = h
b.v = a
e.q = l
e.w = l
e.z = k
h.q = l
h.w = l
h.z = a
a.q = l
a.w = l
a.z = k
k.q = l
k.w = l
k.z = i
assert f.t.w.o.r.z.w.o.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.w: D = None
        self.s: D = None
        self.txt = txt

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

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

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

l = A("l")
f = B("f")
i = C("i")
j = D("j")
b = D("b")
e = C("e")
h = C("h")
a = C("a")
k = C("k")

l.z = h
l.o = f
l.w = b
l.s = b
f.s = a
f.r = l
f.t = h
i.q = l
i.w = l
i.z = a
j.v = h
b.v = a
e.q = l
e.w = l
e.z = k
h.q = l
h.w = l
h.z = a
a.q = l
a.w = l
a.z = k
k.q = l
k.w = l
k.z = i
assert f.t.w.o.r.z.w.o.txt == "f"