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

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: A = None
        self.z: D = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

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

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

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

b.u = g
b.w = g
b.o = i
k.p = g
k.o = j
k.w = i
h.t = m
h.r = b
h.z = j
h.x = n
h.w = k
f.w = j
i.y = f
i.x = k
j.w = f
n.u = b
n.o = i
n.w = g
g.u = b
g.o = i
g.w = n
m.t = h
m.r = g
m.z = f
m.x = n
m.w = k
assert k.w.y.w.w.w.w.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: E = None
        self.w: A = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: A = None
        self.z: D = None
        self.x: A = None
        self.w: B = None
        self.txt = txt

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

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

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

b.u = g
b.w = g
b.o = i
k.p = g
k.o = j
k.w = i
h.t = m
h.r = b
h.z = j
h.x = n
h.w = k
f.w = j
i.y = f
i.x = k
j.w = f
n.u = b
n.o = i
n.w = g
g.u = b
g.o = i
g.w = n
m.t = h
m.r = g
m.z = f
m.x = n
m.w = k
assert k.w.y.w.w.w.w.w.w.txt == "f"