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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.x: B = None
        self.txt = txt

h = A("h")
k = B("k")
l = C("l")
g = D("g")
a = E("a")
m = D("m")
e = B("e")
n = A("n")

h.v = l
k.w = g
k.q = a
k.o = a
k.z = e
k.u = e
l.v = a
g.z = m
g.v = k
a.y = h
a.r = n
a.x = e
m.z = g
m.v = k
e.w = g
e.q = a
e.o = a
e.z = k
e.u = k
n.v = l
assert l.v.r.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.r: A = None
        self.x: B = None
        self.txt = txt

h = A("h")
k = B("k")
l = C("l")
g = D("g")
a = E("a")
m = D("m")
e = B("e")
n = A("n")

h.v = l
k.w = g
k.q = a
k.o = a
k.z = e
k.u = e
l.v = a
g.z = m
g.v = k
a.y = h
a.r = n
a.x = e
m.z = g
m.v = k
e.w = g
e.q = a
e.o = a
e.z = k
e.u = k
n.v = l
assert l.v.r.v.txt == "l"