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

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

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

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

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

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

l.t = j
m.u = j
f.v = k
f.y = k
f.z = g
g.r = a
g.q = j
g.t = m
g.p = m
i.y = j
k.t = n
n.v = k
n.y = k
n.z = g
a.v = l
a.y = k
a.z = g
j.v = k
j.y = l
j.z = g
assert l.t.y.t.y.t.z.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

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

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

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

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

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

l.t = j
m.u = j
f.v = k
f.y = k
f.z = g
g.r = a
g.q = j
g.t = m
g.p = m
i.y = j
k.t = n
n.v = k
n.y = k
n.z = g
a.v = l
a.y = k
a.z = g
j.v = k
j.y = l
j.z = g
assert l.t.y.t.y.t.z.q.z.txt == "g"