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

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

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

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

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

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

l.q = m
l.y = i
l.u = g
n.w = c
n.y = g
c.y = k
g.v = l
j.q = n
j.o = h
m.y = k
k.q = c
k.y = i
k.u = g
i.q = h
i.o = n
h.w = m
h.y = g
assert l.q.y.y.q.w.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

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

l.q = m
l.y = i
l.u = g
n.w = c
n.y = g
c.y = k
g.v = l
j.q = n
j.o = h
m.y = k
k.q = c
k.y = i
k.u = g
i.q = h
i.o = n
h.w = m
h.y = g
assert l.q.y.y.q.w.y.txt == "k"