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

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

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

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

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

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

j.u = m
j.t = m
n.u = k
b.r = k
b.w = j
b.t = h
b.q = h
k.p = j
h.p = n
h.s = n
h.v = j
h.x = j
e.r = k
e.w = j
e.t = h
e.q = h
m.r = k
m.w = j
m.t = h
m.q = h
assert e.t.x.t.r.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

j.u = m
j.t = m
n.u = k
b.r = k
b.w = j
b.t = h
b.q = h
k.p = j
h.p = n
h.s = n
h.v = j
h.x = j
e.r = k
e.w = j
e.t = h
e.q = h
m.r = k
m.w = j
m.t = h
m.q = h
assert e.t.x.t.r.p.t.txt == "m"