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

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

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

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

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

e = A("e")
n = B("n")
g = C("g")
j = D("j")
i = E("i")
f = E("f")
l = C("l")
m = B("m")

e.s = i
n.s = i
n.r = m
g.t = l
j.u = e
j.t = e
j.r = g
i.p = j
i.s = e
i.u = g
f.p = j
f.s = e
f.u = l
l.t = g
m.s = f
m.r = n
assert l.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

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

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

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

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

e = A("e")
n = B("n")
g = C("g")
j = D("j")
i = E("i")
f = E("f")
l = C("l")
m = B("m")

e.s = i
n.s = i
n.r = m
g.t = l
j.u = e
j.t = e
j.r = g
i.p = j
i.s = e
i.u = g
f.p = j
f.s = e
f.u = l
l.t = g
m.s = f
m.r = n
assert l.t.t.t.txt == "g"