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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: D = None
        self.t: D = None
        self.txt = txt

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

e.s = a
e.v = a
e.w = g
e.u = g
l.r = e
l.s = h
g.q = e
g.v = l
k.o = a
k.t = a
m.q = e
m.v = h
h.r = e
h.s = l
j.r = e
j.s = h
a.o = k
a.t = k
b.q = e
b.v = h
assert l.s.r.s.o.o.t.o.txt == "a"