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

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.txt = txt

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

l = A("l")
c = B("c")
d = C("d")
e = D("e")
n = E("n")
i = A("i")
h = B("h")
b = C("b")
g = E("g")
j = C("j")

l.t = e
l.v = g
l.q = b
c.s = l
d.x = e
d.y = e
d.v = h
e.z = d
e.r = g
n.t = c
n.s = e
n.z = g
i.t = e
i.v = n
i.q = d
h.s = i
b.x = e
b.y = e
b.v = h
g.t = c
g.s = e
g.z = n
j.x = e
j.y = e
j.v = h
assert d.y.r.t.s.q.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.v: E = None
        self.q: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.z: C = None
        self.r: E = None
        self.txt = txt

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

l = A("l")
c = B("c")
d = C("d")
e = D("e")
n = E("n")
i = A("i")
h = B("h")
b = C("b")
g = E("g")
j = C("j")

l.t = e
l.v = g
l.q = b
c.s = l
d.x = e
d.y = e
d.v = h
e.z = d
e.r = g
n.t = c
n.s = e
n.z = g
i.t = e
i.v = n
i.q = d
h.s = i
b.x = e
b.y = e
b.v = h
g.t = c
g.s = e
g.z = n
j.x = e
j.y = e
j.v = h
assert d.y.r.t.s.q.txt == "b"