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

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

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

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

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

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

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

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

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

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

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

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

b.u = d
b.v = l
b.t = m
g.t = j
g.o = b
a.z = d
a.u = i
a.w = f
i.w = a
i.q = j
i.s = m
i.o = b
l.p = a
h.p = d
j.w = d
j.q = i
j.s = m
j.o = b
d.z = a
d.u = j
d.w = m
m.t = i
m.o = b
f.t = i
f.o = b
assert f.t.q.s.t.q.w.txt == "d"