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

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

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

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

l = A("l")
i = B("i")
b = C("b")
g = D("g")
e = B("e")
f = D("f")
j = A("j")

l.w = b
l.y = b
l.o = b
l.p = b
i.u = f
i.o = f
i.t = l
b.r = l
b.q = l
b.v = e
b.z = j
g.r = f
g.q = f
g.u = j
g.t = i
e.u = f
e.o = f
e.t = j
f.r = g
f.q = g
f.u = j
f.t = e
j.w = b
j.y = b
j.o = b
j.p = b
assert g.r.q.u.p.q.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.y: C = None
        self.o: C = None
        self.p: C = None
        self.txt = txt

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

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

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

l = A("l")
i = B("i")
b = C("b")
g = D("g")
e = B("e")
f = D("f")
j = A("j")

l.w = b
l.y = b
l.o = b
l.p = b
i.u = f
i.o = f
i.t = l
b.r = l
b.q = l
b.v = e
b.z = j
g.r = f
g.q = f
g.u = j
g.t = i
e.u = f
e.o = f
e.t = j
f.r = g
f.q = g
f.u = j
f.t = e
j.w = b
j.y = b
j.o = b
j.p = b
assert g.r.q.u.p.q.y.q.txt == "l"