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

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

c = A("c")
k = B("k")
g = C("g")
i = D("i")
b = B("b")
n = B("n")
e = D("e")
a = C("a")

c.s = e
c.y = b
c.t = b
k.v = e
k.y = b
k.w = b
g.o = e
i.z = c
i.s = c
i.t = c
b.v = e
b.y = k
b.w = k
n.v = e
n.y = k
n.w = k
e.z = c
e.s = c
e.t = c
a.o = i
assert e.t.t.v.s.t.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: B = None
        self.t: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: A = None
        self.s: A = None
        self.t: A = None
        self.txt = txt

c = A("c")
k = B("k")
g = C("g")
i = D("i")
b = B("b")
n = B("n")
e = D("e")
a = C("a")

c.s = e
c.y = b
c.t = b
k.v = e
k.y = b
k.w = b
g.o = e
i.z = c
i.s = c
i.t = c
b.v = e
b.y = k
b.w = k
n.v = e
n.y = k
n.w = k
e.z = c
e.s = c
e.t = c
a.o = i
assert e.t.t.v.s.t.w.w.txt == "b"