class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

e.x = m
h.w = i
h.o = i
i.r = j
n.p = i
m.t = n
m.s = i
m.q = f
f.t = n
f.s = i
f.q = m
j.w = i
j.o = i
b.x = m
assert h.w.r.o.r.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

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

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

e.x = m
h.w = i
h.o = i
i.r = j
n.p = i
m.t = n
m.s = i
m.q = f
f.t = n
f.s = i
f.q = m
j.w = i
j.o = i
b.x = m
assert h.w.r.o.r.txt == "j"