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

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

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

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

j = A("j")
b = B("b")
a = C("a")
d = D("d")
l = C("l")
n = C("n")
i = C("i")
f = A("f")
m = C("m")
e = C("e")

j.w = b
j.q = d
b.o = n
b.y = j
a.r = d
a.v = i
a.q = m
d.v = f
d.w = f
d.o = f
d.y = b
l.r = d
l.v = i
l.q = m
n.r = d
n.v = m
n.q = i
i.r = d
i.v = n
i.q = l
f.w = b
f.q = d
m.r = d
m.v = n
m.q = a
e.r = d
e.v = i
e.q = a
assert a.q.v.v.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: D = None
        self.txt = txt

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

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

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

j = A("j")
b = B("b")
a = C("a")
d = D("d")
l = C("l")
n = C("n")
i = C("i")
f = A("f")
m = C("m")
e = C("e")

j.w = b
j.q = d
b.o = n
b.y = j
a.r = d
a.v = i
a.q = m
d.v = f
d.w = f
d.o = f
d.y = b
l.r = d
l.v = i
l.q = m
n.r = d
n.v = m
n.q = i
i.r = d
i.v = n
i.q = l
f.w = b
f.q = d
m.r = d
m.v = n
m.q = a
e.r = d
e.v = i
e.q = a
assert a.q.v.v.r.y.txt == "b"