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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.z: B = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

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

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

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

e.y = d
e.t = i
j.q = m
j.w = i
j.t = i
j.u = e
h.y = f
h.z = f
h.p = m
h.v = i
h.s = i
m.t = e
m.q = f
i.q = e
f.q = m
f.w = i
f.t = i
f.u = e
d.y = f
d.p = m
d.z = j
d.v = i
d.s = i
assert f.t.q.y.p.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.z: B = None
        self.v: E = None
        self.s: E = None
        self.txt = txt

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

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

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

e.y = d
e.t = i
j.q = m
j.w = i
j.t = i
j.u = e
h.y = f
h.z = f
h.p = m
h.v = i
h.s = i
m.t = e
m.q = f
i.q = e
f.q = m
f.w = i
f.t = i
f.u = e
d.y = f
d.p = m
d.z = j
d.v = i
d.s = i
assert f.t.q.y.p.t.t.q.txt == "e"