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

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

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

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

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

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

l.v = h
f.o = l
f.u = l
f.y = h
f.q = c
a.x = g
a.u = c
a.r = l
d.y = a
d.u = j
h.x = l
j.v = h
c.x = f
c.u = a
c.r = l
k.y = a
k.u = l
g.o = j
g.u = l
g.y = h
g.q = a
b.o = j
b.u = j
b.y = h
b.q = a
assert g.q.x.u.v.x.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

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

l.v = h
f.o = l
f.u = l
f.y = h
f.q = c
a.x = g
a.u = c
a.r = l
d.y = a
d.u = j
h.x = l
j.v = h
c.x = f
c.u = a
c.r = l
k.y = a
k.u = l
g.o = j
g.u = l
g.y = h
g.q = a
b.o = j
b.u = j
b.y = h
b.q = a
assert g.q.x.u.v.x.v.x.txt == "l"