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

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

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

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

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

i.u = j
i.o = k
i.y = g
j.q = b
j.o = m
e.p = m
e.w = m
e.z = l
b.q = j
b.w = g
g.q = m
g.w = b
l.u = m
l.o = e
l.y = g
m.q = g
m.o = j
k.p = m
k.w = m
k.z = i
assert k.z.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: C = None
        self.y: D = None
        self.txt = txt

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

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

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

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

i.u = j
i.o = k
i.y = g
j.q = b
j.o = m
e.p = m
e.w = m
e.z = l
b.q = j
b.w = g
g.q = m
g.w = b
l.u = m
l.o = e
l.y = g
m.q = g
m.o = j
k.p = m
k.w = m
k.z = i
assert k.z.u.q.txt == "b"