class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: B = None
        self.v: A = None
        self.o: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

a.s = j
a.o = j
a.q = j
a.u = b
a.v = e
b.w = l
b.o = l
b.v = e
b.u = j
b.q = k
g.v = b
g.y = a
j.v = k
l.y = e
e.s = j
e.o = j
e.q = j
e.u = b
e.v = a
k.w = l
k.o = l
k.v = e
k.u = j
k.q = b
m.v = k
m.y = a
f.v = b
f.y = a
assert a.u.v.v.v.s.v.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: B = None
        self.v: A = None
        self.o: D = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

a.s = j
a.o = j
a.q = j
a.u = b
a.v = e
b.w = l
b.o = l
b.v = e
b.u = j
b.q = k
g.v = b
g.y = a
j.v = k
l.y = e
e.s = j
e.o = j
e.q = j
e.u = b
e.v = a
k.w = l
k.o = l
k.v = e
k.u = j
k.q = b
m.v = k
m.y = a
f.v = b
f.y = a
assert a.u.v.v.v.s.v.v.u.txt == "b"