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

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

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

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

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

i = A("i")
f = B("f")
g = C("g")
h = D("h")
c = E("c")
n = E("n")
d = D("d")
k = C("k")

i.s = n
i.u = n
i.w = f
f.v = d
f.w = c
g.s = c
h.w = f
h.t = d
h.y = d
h.o = i
c.v = f
n.v = f
d.w = f
d.t = h
d.y = h
d.o = i
k.s = n
assert i.u.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: B = None
        self.u: E = None
        self.txt = txt

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

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

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

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

i = A("i")
f = B("f")
g = C("g")
h = D("h")
c = E("c")
n = E("n")
d = D("d")
k = C("k")

i.s = n
i.u = n
i.w = f
f.v = d
f.w = c
g.s = c
h.w = f
h.t = d
h.y = d
h.o = i
c.v = f
n.v = f
d.w = f
d.t = h
d.y = h
d.o = i
k.s = n
assert i.u.v.v.txt == "d"