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

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

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

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

i = A("i")
b = B("b")
g = C("g")
m = D("m")
f = A("f")
e = B("e")
h = D("h")
l = B("l")
k = C("k")
c = C("c")

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

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

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

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

i = A("i")
b = B("b")
g = C("g")
m = D("m")
f = A("f")
e = B("e")
h = D("h")
l = B("l")
k = C("k")
c = C("c")

i.w = f
i.z = b
i.u = c
b.r = i
b.u = k
b.t = c
g.q = l
g.v = c
m.v = f
m.y = h
m.o = h
f.w = i
f.z = l
f.u = g
e.r = i
e.u = g
e.t = g
h.v = i
h.y = m
h.o = m
l.r = i
l.u = g
l.t = g
k.q = l
k.v = g
c.q = e
c.v = k
assert k.v.v.q.txt == "e"