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

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.txt = txt

d = A("d")
c = B("c")
j = C("j")
l = D("l")
e = B("e")
k = C("k")
i = A("i")
a = C("a")
f = D("f")

d.q = i
d.u = i
d.s = f
d.t = a
c.u = e
c.t = f
c.o = f
j.s = a
j.v = d
l.u = f
l.x = f
e.u = c
e.t = l
e.o = f
k.s = a
k.v = i
i.q = d
i.u = d
i.s = l
i.t = a
a.s = j
a.v = i
f.u = l
f.x = l
assert a.v.t.s.s.v.t.v.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.s: D = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.x: D = None
        self.txt = txt

d = A("d")
c = B("c")
j = C("j")
l = D("l")
e = B("e")
k = C("k")
i = A("i")
a = C("a")
f = D("f")

d.q = i
d.u = i
d.s = f
d.t = a
c.u = e
c.t = f
c.o = f
j.s = a
j.v = d
l.u = f
l.x = f
e.u = c
e.t = l
e.o = f
k.s = a
k.v = i
i.q = d
i.u = d
i.s = l
i.t = a
a.s = j
a.v = i
f.u = l
f.x = l
assert a.v.t.s.s.v.t.v.s.u.txt == "f"