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

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

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

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

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

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

h.t = j
h.q = j
h.r = d
h.o = d
h.w = d
d.v = n
i.p = d
i.w = h
i.q = a
a.o = m
g.v = n
g.p = a
g.y = d
j.v = f
j.p = a
j.y = d
m.t = g
m.r = d
m.o = d
m.w = d
m.q = j
n.p = d
n.w = m
n.q = a
f.p = d
f.w = h
f.q = a
assert f.p.v.q.o.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.r: B = None
        self.o: B = None
        self.q: E = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

h.t = j
h.q = j
h.r = d
h.o = d
h.w = d
d.v = n
i.p = d
i.w = h
i.q = a
a.o = m
g.v = n
g.p = a
g.y = d
j.v = f
j.p = a
j.y = d
m.t = g
m.r = d
m.o = d
m.w = d
m.q = j
n.p = d
n.w = m
n.q = a
f.p = d
f.w = h
f.q = a
assert f.p.v.q.o.txt == "m"